//------------------------------------------------------------------------------
// @description 超级管理员端所有组件的状态
//------------------------------------------------------------------------------

import { defineStore } from "pinia";

//------------------------------------------------------------------------------
// 左侧菜单栏相关状态
//------------------------------------------------------------------------------

//左侧菜单栏切换的加载动画状态
export const useSuperAdmMenuLoading = defineStore('superAdmMenuLoading', {
    state: () => {
        return {
            menuLoading: false // 菜单加载状态
        }
    },
    actions: {
        setMenuLoading(loading) {
            this.menuLoading = loading;
        }
    }
})



//------------------------------------------------------------------------------
// 分数总览相关状态
//------------------------------------------------------------------------------

// 该状态用于控制分数总览的进行中和已结束的加载动画
export const useSuperAdmOverviewTableLoading = defineStore('superAdmOverviewTableLoading', {
    state: () => {
        return {
            overviewTableLoading: false
        }
    },
    actions: {
        setOverviewTableLoading(loading) {
            this.overviewTableLoading = loading;
        }
    }
})

//------------------------------------------------------------------------------
// 管理员管理相关状态
//------------------------------------------------------------------------------
//该状态用于控制是否展示教师管理端的对话框
export const useSuperAdmTeacher = defineStore('superAdmTeacher', {
    state: () => {
        return {
            createTeacherDialogVisible: false,//是否展示新建管理员的对话框
            importDialogVisible: false,//是否展示批量导入的对话框
        }
    },
    actions: {
        setCreateTeacherDialogVisible(visible) {
            this.createTeacherDialogVisible = visible;
        },
        setImportDialogVisible(visible) {
            this.importDialogVisible = visible;
        }
    }
})


//该状态用于控制是否展示学生管理端的对话框
export const useSuperAdmStudent = defineStore('superAdmStudent', {
    state: () => {
        return {
            createStudentDialogVisible: false,//是否展示新建管理员的对话框
            importDialogVisible: false,//是否展示批量导入的对话框
        }
    },
    actions: {
        setCreateStudentDialogVisible(visible) {
            this.createStudentDialogVisible = visible;
        },
        setImportDialogVisible(visible) {
            this.importDialogVisible = visible;
        }
    }
})